package domain.entities;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Closuredocuments entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "closuredocuments", catalog = "bms")
public class Closuredocuments implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private String description;
	private Date receivedBms;
    private Date sentToSite;

    public static ArrayList<String> getDescriptions(){
        ArrayList<String> descripciones = new ArrayList<String>(0);
        descripciones.add("Delegation of Authority (original)");
        descripciones.add("Monitoring Log  signed (CT SOP 503) - original");
        descripciones.add("Closure letter signed by SMN (CT SOP 503)");
        descripciones.add("Final Reconcialiation");
        descripciones.add("Copy of the  Drug inventory Log");
        descripciones.add("TAO CD: acknowledgnment of receipt");
        return descripciones;
    }

    // Constructors

	/** default constructor */
	public Closuredocuments() {
	}

	/** minimal constructor */
	public Closuredocuments(String description) {
		this.description = description;
	}

	/** full constructor */
	public Closuredocuments(ProtocoloCentro protocoloCentro,
			String description, Date receivedBms) {
		this.protocoloCentro = protocoloCentro;
		this.description = description;
		this.receivedBms = receivedBms;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "receivedBMS", length = 10)
	public Date getReceivedBms() {
		return this.receivedBms;
	}

	public void setReceivedBms(Date receivedBms) {
		this.receivedBms = receivedBms;
	}

    @Temporal(TemporalType.DATE)
    @Column(name = "sentToSite", length = 10)
    public Date getSentToSite() {
        return sentToSite;
    }

    public void setSentToSite(Date sentToSite) {
        this.sentToSite = sentToSite;
    }
}